﻿package kliment.events {
	import flash.events.Event;
	import kliment.net.AMFResponder;

	/**
	 * ...
	 * @author Kliment
	 * @version 1.1.3
	 *
	 * class name: kliment.events.AMFResponderEvent
	 */
	public class AMFResponderEvent extends Event {
		static public const COMPLETE:String = 'complete';
		static public const ERROR:String = 'error';

		private var _responder:AMFResponder;
		private var _result:Object;
		private var _status:Object;

		public function AMFResponderEvent(type:String, responder:AMFResponder, resultObj:Object = null, statusObj:Object = null) {
			super(type);
			_responder = responder;
			_result = resultObj;
			_status = statusObj;
		}

		override public function get target():Object { return _responder; }

		override public function get currentTarget():Object { return _responder; }

		public function get responder():AMFResponder { return _responder; }

		public override function clone():Event {
			return new AMFResponderEvent(type, _responder, _result, _status);
		}

		public override function toString():String {
			return formatToString("AMFResponderEvent", "type", "bubbles", "cancelable", "eventPhase");
		}

		public function get result():Object { return _result; }

		public function get status():Object { return _status; }

	}

}